<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/bom/bom/BOM_Accessory.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/bom/bom/BOM_Accessory.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ID',
                footer: "Foots",
                cnName: 'BOM配件',
                name: 'bom/BOM_Accessory',
                url: "/BOM_Accessory/",
                sortName: "ID"
            });
            const editFormFields = ref({"SerialNumber":"","ItemName":"","SpecificationModel":"","Unit":"","Brand":"","QuantityAccessories":"","LossKey":"","CurrentInventory":"","AvailableProduction":""});
            const editFormOptions = ref([[{"title":"物品编号","field":"SerialNumber","type":"text"}],
                              [{"title":"物品名称","field":"ItemName","type":"text"}],
                              [{"title":"规格型号","field":"SpecificationModel","type":"text"}],
                              [{"title":"单位","field":"Unit","type":"text"}],
                              [{"title":"品牌","field":"Brand","type":"text"}],
                              [{"title":"配件数量","field":"QuantityAccessories","type":"text"}],
                              [{"title":"损耗率","field":"LossKey","type":"text"}],
                              [{"title":"当前库存","field":"CurrentInventory","type":"text"}],
                              [{"title":"可供生产","field":"AvailableProduction","type":"text"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'ID',title:'配件ID',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'SerialNumber',title:'物品编号',type:'string',width:110,align:'left',sort:true},
                       {field:'ItemName',title:'物品名称',type:'string',width:110,align:'left'},
                       {field:'SpecificationModel',title:'规格型号',type:'string',width:110,align:'left'},
                       {field:'Unit',title:'单位',type:'string',width:110,align:'left'},
                       {field:'Brand',title:'品牌',type:'string',width:110,align:'left'},
                       {field:'QuantityAccessories',title:'配件数量',type:'int',width:110,align:'left'},
                       {field:'LossKey',title:'损耗率',type:'string',width:110,align:'left'},
                       {field:'CurrentInventory',title:'当前库存',type:'int',width:110,align:'left'},
                       {field:'AvailableProduction',title:'可供生产',type:'int',width:110,align:'left'},
                       {field:'CreateID',title:'创建人ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人',type:'string',width:130,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:110,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'修改ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人',type:'string',width:130,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:110,hidden:true,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
